#pragma once

#include "Common/EffectDefine.h"
#include "base/core/singleton.h"
#include <map>

class Creature;
class IEffect;

//效果管理器
class EffectManager : public ManualSingleton<EffectManager>
{
	typedef std::map<uint32_t, IEffect*> EffectMap;

public:
	EffectManager();
	virtual ~EffectManager();

public:
	bool		Init();
	void		UnInit();

	//效果系统调用
	int32_t		OnEffect(Creature *pCreatrue, EffectIDType effectId);
	int32_t		RemoveEffect(Creature *pCreatrue, EffectIDType effectId);

private:
	EffectMap	m_pEffects;
};

#define g_MakeEffectMgr() (EffectManager::Instance())
#define g_GetEffectMgr()  (EffectManager::GetInstance())
#define g_DelEffectMgr()  (EffectManager::Destroy())